#include <cstdio>

int gcd(int a, int b);
int lcm(int a, int b);

int main(int argc, char const *argv[]){
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++){
        int m;
        scanf("%d", &m);
        int current_lcm = 1;
        int next_num;
        while(m > 0){
            scanf("%d", &next_num);
            current_lcm = lcm(current_lcm, next_num);
            m--;
        }
        printf("%d\n", current_lcm);
    }
    return 0;
}

int gcd(int a, int b){
    return b != 0 ? gcd(b, a % b) : a;
}

int lcm(int a, int b){
    return a / gcd(a, b) * b; // in case of overflow
}
